package com.tk.ad.sdk.core;

import android.content.Context;

import com.tk.ad.sdk.api.ADApi;
import com.tk.ad.sdk.utils.AppLog;

import java.util.Map;


/**
 * Created by hsy on 2017/4/21.
 */

public class ADSDK {


    private static Context mContext;


    public static void init(Context context) {
        mContext = context;
        ADApi.getInstance(mContext).init();
    }

    public static void setAppKey(String appKey) {
        if(mContext == null){
            AppLog.getInstance().e("未初始化TKSDK");
            return;
        }
        ADApi.getInstance(mContext).setAppKey(appKey);
    }

    //默认开启
    public static void debug(boolean debug){
        AppLog.ENABLE_DEBUG = debug;
        AppLog.ENABLE_INFO = debug;
        AppLog.ENABLE_ERROR = debug;
        AppLog.ENABLE_WARN = debug;
        AppLog.ENABLE_VERBOSE = debug;
    }

    public static void sendAdTrack(){
        if(mContext == null){
            AppLog.getInstance().e("未初始化TKSDK");
            return;
        }
        ADApi.getInstance(mContext).sendAdTrack();
    }


//    //统计页面访问量
//    public static void onPageView(String page) {
//
//    }
//
//    public static void onEvent() {
//
//    }
//
//    //事件点击
//    public static void onCustEvent(Map<String, String> map) {
//        //调用服务器接口
//    }
//
//    //事件点击2
//    public static void onCustEvent2() {
//
//    }


}
